import java.util.ArrayList;
import java.util.List;

public class test18 {

    public static void main(String[] args) {

        ArrayList<Alto> at=new ArrayList<>();
        at.add(new Alto("奥拓","黑色",8000));

       List<Audi> ad=new ArrayList<>();
       ad.add(new Audi("奥迪","白色",6000));
        RentalHouse  r=new RentalHouse();

        List<Car> ca=new ArrayList<>();

        ca.addAll(at);
        ca.addAll(ad);


        for (Car car : ca) {
           if (car instanceof Alto){
               double rent = r.rent(car, 200);
               System.out.println("奥拓:"+rent);
           }
            if (car instanceof Audi){
                double rent1 = r.rent(car, 600);
                System.out.println("奥迪:"+rent1);
            }
        }


    }
}
